package cn.wzvtc.ch78freemarker;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class FreeMarkerController {

    @RequestMapping(value = "/freemarker", method = RequestMethod.GET)
    public String testwebjars(Model model) {
        //模板的模型对象的属性设置
        model.addAttribute("name", "freemarker1");
        return "hello";//模板的名称
    }

    @RequestMapping(value = "/testwebjars", method = RequestMethod.GET)
    public String testwebjars2() {
        return "testwebjars";//模板名称
    }

}
